#define _CRT_SECURE_NO_WARNINGS 1


#include<stdio.h>

void SLTPopBack(SLNode** pphead)
{
	if (*pphead->next == NULL)
	{
		free(*pphead);
		*pphead = NULL;
	}
	else
	{
		SLNode* tail = *pphead->next;
		SLNode* prev = *pphead;
		while (tail->next != NULL)
		{
			tail = tail->next;
			prev = prev->next;
		}
		free(tail);
		prev->next = NULL;
	}
}



void SLTPopFront(SLNode** pphead)
{
	assert(*pphead);

	if (*pphead->next == NULL)
	{
		free(*pphead);
		*pphead = NULL;
	}
	else
	{
		SLNode* tail = *pphead;
		*pphead = *pphead->next;
		free(tail);
	}

}







